<!DOCTYPE html>
<html lang="en" ng-app="notesApp">
<head >
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body ng-controller="MainCtrl as ctrl">

<h1 >Hello {{1+2}}</h1>

<input ng-model="name" placeholder="请输入变量值！">
<h1 >Hello {{name}}</h1>


{{ctrl.helloMsg}} Angularjs.
<br/>
{{ctrl.goodbyeMsg}} Angularjs

<button ng-click="ctrl.changeMessage()">改变message</button>

<div ng-repeat="note in ctrl.notes">
    <span class="label">{{note.label}}</span>
    <span class="status" ng-bind="note.done"></span>
</div>



<script src="angular.js">
</script>

<script>
    angular.module("notesApp",[])
            .controller("MainCtrl",[function(){
                var self=this;
                self.helloMsg="Hello";
                self.goodbyeMsg="GoodBye";

                self.changeMessage=function(){
                    self.helloMsg="Goodbye";
                    self.notes.push({id:4,label:'我是第四个',done:true});
                };

                self.notes=[
                    {id:1,label:'First Note',done:false}
                    ,{id:2,label:'Second Note',done:false}
                    ,{id:3,label:'Third Note',done:true}
                ];
            }]);
</script>
</body>
</html>